package com.jingdianjichi.oss.adapter;

import com.jingdianjichi.oss.entity.FileInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * ClassName:AliStorageServiceImpl
 * Package:IntelliJ IDEA
 * Description:
 *
 * @Author xiaoming
 * @Create 2025/2/21 19:27
 * @Version 1.0
 */

public class AliStorageAdapter implements StorageAdapter {
    /**
     * 创建桶
     *
     * @param bucket
     */
    @Override
    public void createBucket(String bucket) {

    }

    /**
     * 上传文件
     *
     * @param inputStream
     * @param bucket
     * @param objectName
     */
    @Override
    public void uploadFile(MultipartFile inputStream, String bucket, String objectName) {

    }

    /**
     * 列出所有桶
     */
    @Override
    public List<String> getAllBucket() {
        List<String> bucketNameList = new LinkedList<>();
        bucketNameList.add("aliyun");
        return bucketNameList;
    }

    /**
     * 列出当前桶和文件
     *
     * @param bucket
     */
    @Override
    public List<FileInfo> getAllFile(String bucket) {
        return Collections.emptyList();
    }

    /**
     * 下载文件
     *
     * @param bucket
     * @param objectName
     * @return
     * @throws Exception
     */
    @Override
    public InputStream downLoad(String bucket, String objectName) {
        return null;
    }

    /**
     * 删除桶
     *
     * @param bucket
     */
    @Override
    public void deleteBucket(String bucket) {

    }

    /**
     * 删除文件
     *
     * @param bucket
     * @param objectName
     * @throws Exception
     */
    @Override
    public void deleteObject(String bucket, String objectName) {

    }
}
